


use "$clean/clean_all.dta" ,clear

ren  canvass_any_before_main_unres   canvass_any_before
global contr_short female age member years_member experience canv_workshop canvass_any_before app_before_main

		   
	   
loc experiments "1 2 3 4 5 6 7 8 9"

		   
preserve

clear all
eststo clear
estimates drop _all

set obs 10
qui gen x = 1
qui gen y = 1

loc columns = 0

foreach choice in `experiments' {

    loc ++columns
    qui eststo col`columns': reg x y

}

restore


/* Statistics */

loc colnum = 1
loc colnames ""


foreach choice in $contr_short {

/* Statistics */
local temp "$contr"
local not "`choice'"
local contr: list temp- not
di "`choice'" "  `contr'"	
	
 reg  canvass_any_main_unres i.treatment##c.(`choice') $contr_short , robust

 est store un_`choice'
	
	}
	
	
 reg  canvass_any_main_unres i.treatment##c.($contrshort) , robust
 
  est store un_all
	

local coeflabels 1.treatment "Treatment" 1.treatment#c.female "\midrule Treatment $\times$ Female" female "Female" ///
										 1.treatment#c.age "Treatment $\times$ Age" age "Age" ///
								         1.treatment#c.member "Treatment $\times$ Member " member "Member" ///
										 1.treatment#c.years_member "Treatment $\times$ Membership years " years_member "Memberships years" ///
										 1.treatment#c.canv_workshop "Treatment $\times$ Canvassing workshop " tzt_workshop "Canvassing workshop" ///
										 1.treatment#c.experience "Treatment $\times$ Experience" experience "Experience" ///										 
										 1.treatment#c.canvass_any_before  "Treatment $\times$ Has canvassed this election " canvass_any_before_main_unres  "Has canvassed this election" ///
										 1.treatment#c.app_before_main  "Treatment $\times$ Downloaded app before survey" app_before_main  "Downloaded app before survey" ///
										 _cons "Constant"
				
			
				
local order 1.treatment 				 1.treatment#c.female  1.treatment#c.age  ///
								         1.treatment#c.member   1.treatment#c.years_member   ///
										 1.treatment#c.experience   1.treatment#c.canv_workshop    ///
										 1.treatment#c.canvass_any_before   ///
										 1.treatment#c.app_before_main // female age member years_member experience tzt_workshop  canvass_any_before_main app_before_main   _cons 

esttab un* using "$tables/Table_A20.tex", replace booktabs nonotes nonum compress alignment(c) noobs nobaselevels label stats(r2 N , fmt(3 0) labels( "R-squared" "Observations")) ///
   coeflabels("`coeflabels'") order(`order')  b(%9.3f) se(%9.3f)  star(* 0.1001 ** 0.0501 *** 0.0101) ///
   keep( `order'  ) mlabels(none) ///
   mgroups("Dependent Variable: Any canvassing",  pattern(1 0 0 0 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))   
   
   
